<?php

function smarty_block_admin_hello($params, $tagdata, &$smarty, &$repeat) { 
	if (!isset($params['var'])) {
		die();
	}
	else{
		if ($params['type']=='admin_hello'){
			if ($smarty->CI->admin_model->logged_in()){
				$html = '';
				$html = '<div id="logged_in">';
				$html = 'Đăng nhập bằng <span class="username">'.$smarty->CI->admin_model->get('admin_name').'</span> (<a href="http://localhost/hero_os/admincp/logout">logout</a>)';
				$html = '</div>';
			}else{
				$html ='';
			}
			$smarty->assign('admin_name',$html);
		}
	}
}